<?php
	require_once('config.php');
	require_once('db.php');
	$link = connectdb($servername,$dbname,$dbusername,$dbpassword);
	$id=$_GET['id'];
	$sql="DELETE FROM site_protocol WHERE protocol_id='$id'";
	$result=mysql_query($sql, $link);
	if ($result)
	{		
		$id=$_GET['id'];
		$sql="DELETE FROM protocols WHERE id='$id'";
		$result=mysql_query($sql);
		if($result){
			$message = urldecode("<b>Delete successfully</b>");
			close($link);
			header("Location: protocols.php?message=" . $message);
		}else{
			$message = urldecode("There is an MySQL error occurred: <b>" . mysql_error($link) . "</b>");
			close($link);
			header("Location: protocols.php?message=" . $message);
		}
		
	}
	else 
	{
		$message = urldecode("There is an MySQL error occurred: <b>" . mysql_error($link) . "</b>");
		close($link);
		header("Location: protocols.php?message=" . $message);
	}
?>